package com.shenzhen.horselive.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.shenzhen.horselive.R;
import com.shenzhen.horselive.beans.AuctionDetailsRecordList;

import org.jetbrains.annotations.NotNull;

public class AuctionDetailsAdapter extends BaseQuickAdapter<AuctionDetailsRecordList.DataBean, BaseViewHolder> {
    public AuctionDetailsAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, AuctionDetailsRecordList.DataBean s) {
        baseViewHolder.setText(R.id.tv_title,s.getUserName())
                .setText(R.id.tv_time,s.getBidTime())
                 .setText(R.id.tv_price,s.getBidPriceFz()+"峰值")
        ;
        //是否是本人区分显示
        if ("1".equals(s.getIsSelf())||"true".equals(s.getIsSelf()))
        {
            baseViewHolder.setVisible(R.id.tv_is_me,true);
        }
        else
        {
            baseViewHolder.setVisible(R.id.tv_is_me,false);
        }

        //当前价格
       if (baseViewHolder.getAdapterPosition()==1)
       {
           baseViewHolder.setVisible(R.id.tv_now_price,true);
           baseViewHolder.setTextColorRes(R.id.tv_title,R.color.red_common);
       }
       else
       {
           baseViewHolder.setVisible(R.id.tv_now_price,false);
           baseViewHolder.setTextColorRes(R.id.tv_title,R.color.color_3);
       }



    }
}
